package com.zt.weibo.vo;

import com.google.gson.annotations.SerializedName;

/**
 * 微博的信息的类，内含该微博的作者信息类，如果有转发，则还包含被转发的微博信息类。
 * @author zhaotong
 */
public class StatusInfo extends WeiboInfo
{
	/**
	 * 序列化序号
	 */
	private static final long serialVersionUID = 4744311994528041449L;

	/**
	 * 是否收藏了该条微博
	 */
	@SerializedName(value = "favorited")
	public boolean bIsFavorit;
	
	/**
	 * 是否截断了该条微博
	 */
	@SerializedName(value = "truncated")
	public boolean bIsTruncat;
	
	/**
	 * 回复的ID
	 */
	@SerializedName(value = "in_reply_to_status_id")
	public String in_reply_to_status_id;
	
	/**
	 * 回复人的ID
	 */
	@SerializedName(value = "in_reply_to_user_id")
	public String in_reply_to_user_id;
	
	/**
	 * 回复人的昵称
	 */
	@SerializedName(value = "in_reply_to_screen_name")
	public String in_reply_to_screen_name;
	
	/**
	 * 缩略图地址
	 */
	@SerializedName(value = "thumbnail_pic")
	public String strThumbnailPic;
	
	/**
	 * 中等图地址
	 */
	@SerializedName(value = "bmiddle_pic")
	public String strBmiddlePic;
	
	/**
	 * 原始图地址
	 */
	@SerializedName(value = "original_pic")
	public String strOriginalPic;
	
	/**
	 * 地理位置
	 */
	@SerializedName(value = "geo")
	public String strGeo;
	
	/**
	 * 转发数
	 */
	@SerializedName(value = "reposts_count")
	public int iRepostsCount;
	
	/**
	 * 评论数
	 */
	@SerializedName(value = "comments_count")
	public int iCommentsCount;
	
	/**
	 * 作者信息
	 */
	@SerializedName(value = "user")
	public UserInfo mUserInfo;
	
	/**
	 * 被该条微博转发的微博原文信息
	 */
	@SerializedName(value = "retweeted_status")
	public StatusInfo mRetweetInfo;
	
	/**
	 * 0,正常；1，被删除。
	 */
	@SerializedName(value = "deleted")
	public int iDeleted;
	
	/**
	 * 是否转发了另一条微博
	 */
	public boolean bIsRetweetOther;
	
	public StatusInfo()
	{
		strId = "";
		strCreatTime = "";
		strSource = "";
		strContent = "";
		bIsFavorit = false;
		bIsTruncat = false;
		in_reply_to_status_id = "";
		in_reply_to_user_id = "";
		in_reply_to_screen_name = "";
		strThumbnailPic = "";
		strBmiddlePic = "";
		strOriginalPic = "";
		strGeo = "";
		iRepostsCount = 0;
		iCommentsCount = 0;
		mUserInfo = new UserInfo();
		bIsRetweetOther = false;
		iDeleted = 0;
	}

	public void setRetweetInfo(StatusInfo retweetInfo)
	{
		mRetweetInfo = retweetInfo;
		bIsRetweetOther = true;
	}
	
	@Override
	public String toString()
	{
		StringBuffer stringBuffer = new StringBuffer();
		stringBuffer.append("Favorited = " + bIsFavorit + "\n");
		stringBuffer.append("Truncated = " + bIsTruncat + "\n");
		stringBuffer.append("Replay Status Id = " + in_reply_to_status_id + "\n");
		stringBuffer.append("Replay User Id = " + in_reply_to_user_id + "\n");
		stringBuffer.append("Replay Screen Name = " + in_reply_to_screen_name + "\n");
		stringBuffer.append("Thumbnail Pic = " + strThumbnailPic + "\n");
		stringBuffer.append("Bmiddle Pic = " + strBmiddlePic + "\n");
		stringBuffer.append("Original Pic = " + strOriginalPic + "\n");
		stringBuffer.append("Geo = " + strGeo + "\n");
		stringBuffer.append("Reposts Count = " + iRepostsCount + "\n");
		stringBuffer.append("Comments Count = " + iCommentsCount + "\n");
		if(bIsRetweetOther)
		{
			return super.toString() + stringBuffer.toString() + mUserInfo.toString() + mRetweetInfo.toString();
		}
		return super.toString() + stringBuffer.toString() + mUserInfo.toString();
	}
	
	
}
